package com.im.partchat.http.service;

import com.im.partchat.bean.main.MainNewData;
import com.im.partchat.bean.reponsed.BaseResponse;
import com.im.partchat.bean.request.RequestBean;
import com.im.partchat.http.api.NewsApi;
import com.im.partchat.http.apiManager.ApiManager;

import java.util.List;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * Created by flyou on 2017/6/30.
 * VersionCode: 1
 * Desc:
 */

public class NewsService {

    public static Observable<BaseResponse<List<Object>>> getNews(RequestBean<String> requestBean) {
        return ApiManager.getInstance().getApi(NewsApi.class).getNews(requestBean,requestBean.getColumn())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());

    }
    public static Observable<BaseResponse<MainNewData>> getMainNews(RequestBean<String> requestBean) {
        return ApiManager.getInstance().getApi(NewsApi.class).getMainNew(requestBean,requestBean.getColumn())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io());

    }
}